<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function now(){
				var today=new Date();
				var YYYY=today.getFullYear();
				var MM=today.getMonth();
				var DD=today.getDate();
				var zhouji=today.getDay();//星期几(0~6)
				var hh=today.getHours();
				var mm=today.getMinutes();
				var ss=today.getSeconds();
				var week=["星期一","星期二","星期三","星期四","星期五","星期六","星期日"];
				var a=["am","pm"];
				var b;
				if(hh>=12){
					b=a[1];
					hh=hh-12;
				}else{
					b=a[0];
				}
				document.getElementById("myclock").innerHTML="现在是:"+hh+":"+mm+":"+ss+"<br/>"+YYYY+"年"+MM+"月"+DD+"日<br/>"+"星期"+zhouji+week[zhouji-1]+" "+b;
				now1();
			}
			function now1(){
				var myTime=setInterval("now()",1000);
			}
		</script>
	</head>
	<body>
		<input type="button" value="现在时间" onclick="now1()"/>
		<div id="myclock">
			
		</div>
	</body>
</html>
